package cn.net.cfss.fgbp.api.console.inte;

import cn.net.cfss.fgbp.api.console.constant.Constants;
import cn.net.cfss.fgbp.api.console.dto.SysUserLoginLogDto;
import cn.net.cfss.fgbp.base.page.PageData;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

@FeignClient(name = Constants.SPI_SERVER_NAME)
@RequestMapping("userLoginLog")
public interface ISysUserLoginLogService {

    /**
     * 保存登录/登出日志
     *
     * @param sysUserLoginLogDto
     * @return
     */
    @RequestMapping(value = "/save", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public SysUserLoginLogDto saveLog(@RequestBody SysUserLoginLogDto sysUserLoginLogDto);

    /**
     * 根据ID查询用户登录/登出日志
     *
     * @param loginLogId
     * @return
     */
    @RequestMapping(value = "/get/{loginLogId}", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
    public SysUserLoginLogDto get(@PathVariable(value = "loginLogId") Long loginLogId);

    /**
     * 分页查询用户登录日志
     *
     * @param page
     * @return
     */
    @RequestMapping(value = "/query/page", method = RequestMethod.POST, produces = "application/json;charset=UTF-8")
    public PageData<SysUserLoginLogDto> queryByPage(@RequestBody PageData<SysUserLoginLogDto> page);

}
